package com.china.cnlongdb.basic.constant;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

import com.china.cnlongdb.basic.entity.backups.LongdbBackupsEntity;
import com.china.cnlongdb.basic.entity.database.LongDataBaseEntity;
import com.china.cnlongdb.basic.entity.database.LongTableEntity;
import com.china.cnlongdb.basic.entity.insert.InsertDataEntity;
import com.china.cnlongdb.basic.entity.update.UpdateDateEntity;

/**
 * 系统名称：ConcurrentDataMap.java
 * 模块名称：
 * 模块描述：longdb - 数据库操作引擎
 * 功能列表：
 * 模块作者：ZOUYONG
 * 开发时间：2018年12月5日 下午9:44:33
 * 模块路径：com.china.cnlongdb.server.engine.ConcurrentDataMap
 * 更新记录：
 */
public class ConcurrentDataMap {
	
	// 存储新增的数据集合对象（未开启事务）
	public static final ConcurrentHashMap<String, InsertDataEntity> insertDataMap = new ConcurrentHashMap<String, InsertDataEntity>();
	
	// 存储临时的要新增的数据集合对象（开启事务）
	public static final ConcurrentHashMap<String, ConcurrentHashMap<String, InsertDataEntity>> tempInsertDataMap = 
			new ConcurrentHashMap<String, ConcurrentHashMap<String, InsertDataEntity>>();

	// 存储临时的要修改或删除的数据集合对象（开启事务）
	public static final ConcurrentHashMap<String, List<UpdateDateEntity>> tempUpdDelDataMap = new ConcurrentHashMap<String, List<UpdateDateEntity>>();
	
	// 表数据配置文件：原始数据行数集合
	// public static final ConcurrentHashMap<String, Integer> dataFileOldRowCountMap = new ConcurrentHashMap<String, Integer>();
	
	// 存储有行数发生变化的表信息
	public static final ConcurrentHashMap<String, LongTableEntity> dataFileNewRowCountMap = new ConcurrentHashMap<String, LongTableEntity>();
	
	// ===============================================================================================================
	
	// 全局的数据库配置信息
	public static ConcurrentHashMap<String, LongDataBaseEntity> longDataBaseMap = new ConcurrentHashMap<String, LongDataBaseEntity>();

	// 全局的数据表配置信息
	public static ConcurrentHashMap<String, LongTableEntity> longdbTableMap = new ConcurrentHashMap<String, LongTableEntity>();
	
	// 全局的数据同步或备份信息
	public static List<LongdbBackupsEntity> longdbBackupsList = new ArrayList<LongdbBackupsEntity>();
	
}
